﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using shop.entity;
using shop.service;

namespace shop.web.view_admin.goods
{
    public partial class List : System.Web.UI.Page
    {
        protected List<Goods> goodsListInfo;
        private GoodsService goodsService = new GoodsService();

        protected List<Catagory> catagoryList;
        private CatagoryService catagoryService = new CatagoryService();
        protected void Page_Load(object sender, EventArgs e)
        {
            int categoryId = 0;
            try
            {
                categoryId = int.Parse(Request["catagoryId"]);
            }
            catch (Exception ex)
            {
                categoryId = 0;
                Console.Write(ex.Message);
            }
            catagoryList = catagoryService.ListCatagory();
            Goods goods = new Goods() {
                CategoryId = categoryId
            };
            goodsListId.DataSource = goodsService.ListGoods(15,goods);
            goodsListId.DataBind();
        }
    }
}